package com.hudongwx.food.fargment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hudongwx.food.R;
import com.hudongwx.food.activity.LoginActivity;
import com.hudongwx.food.activity.MoreActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.x;

/**
 * 我的
 * A simple {@link Fragment} subclass.
 */
@ContentView(R.layout.fragment_my)
public class MyFragment extends Fragment {
private View view;
    Intent intent = new Intent();
    @Override
    public View onCreateView(final LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        if (null==view){
            view = x.view().inject(this,inflater,container);
        }
        TextView tv = (TextView) view.findViewById(R.id.my_login);
        ImageView iv = (ImageView) view.findViewById(R.id.my_img);
        LinearLayout l1 = (LinearLayout) view.findViewById(R.id.my_shequ);
        LinearLayout l2 = (LinearLayout) view.findViewById(R.id.my_pwd);
        LinearLayout l3 = (LinearLayout) view.findViewById(R.id.my_xiaoxi);
        LinearLayout l4 = (LinearLayout) view.findViewById(R.id.my_gengduo);

        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent.setClass(getActivity(),LoginActivity.class);
                startActivity(intent);
            }
        });
        iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent.setClass(getActivity(),LoginActivity.class);
                startActivity(intent);
            }
        });
        l1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent.setClass(getActivity(),LoginActivity.class);
                startActivity(intent);
            }
        });
        l2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent.setClass(getActivity(),LoginActivity.class);
                startActivity(intent);
            }
        });
        l3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent.setClass(getActivity(),LoginActivity.class);
                startActivity(intent);
            }
        });
        l4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent.setClass(getActivity(),MoreActivity.class);
                startActivity(intent);
            }
        });
        return view;

    }

}
